/// 头像上传响应模型
/// 
/// 对应接口: POST /api/upload/avatar
/// 用于封装头像上传操作的响应信息
class AvatarUploadResp {
  /// 是否成功
  final bool success;
  
  /// 头像URL
  final String? imgUrl;
  
  /// 错误信息
  final String? errorMessage;
  
  const AvatarUploadResp._({
    required this.success,
    this.imgUrl,
    this.errorMessage,
  });
  
  /// 创建成功响应
  factory AvatarUploadResp.success(String imgUrl) {
    return AvatarUploadResp._(success: true, imgUrl: imgUrl);
  }
  
  /// 创建失败响应
  factory AvatarUploadResp.failure(String errorMessage) {
    return AvatarUploadResp._(
      success: false,
      errorMessage: errorMessage,
    );
  }
  
  @override
  String toString() {
    return 'AvatarUploadResp(success: $success, imgUrl: $imgUrl, errorMessage: $errorMessage)';
  }
}

